<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
</head>
<body>
<h3>修改用户</h3>
<hr/>
<form th:action="@{/emp/add}" method="post">
    <input type="hidden" name="type" th:value="${type}"/><br/>
    <input type="hidden" name="id" th:value="${emp.id}"/><br/>
    姓名：<input type="text" name="name" th:value="${emp.name}"/><br/>
    性别：<input type="radio" name="sex" value="男" th:attr="checked=${emp.sex=='男'}"/>男
    <input type="radio" name="sex" value="女" th:attr="checked=${emp.sex=='女'}"/>女<br/>
    出生日期：<input type="date" name="birth" th:value="${#dates.format(emp.birth,'yyyy-MM-dd')}"/><br/>
    入职时间：<input type="date" name="date" th:value="${#dates.format(emp.date,'yyyy-MM-dd')}"/><br/>
    学历：<input type="text" name="xveli" th:value="${emp.xveli}"/><br/>
    职务:<select name="zid">
        <option th:each="z : ${zList}" th:value="${z.zid}" th:text="${z.zname}" th:attr="checked=${emp.zid==z.zid}"></option>
    </select><br>
    地址：<input type="text" name="address" th:value="${emp.address}"/><br/>
    电话：<input type="text" name="phone" th:value="${emp.phone}"/><br/>
    紧急联系人：<input type="text" name="phonex" th:value="${emp.phonex}"/><br/>
    密码：<input type="password" name="pwd" th:value="${emp.pwd}"/><br/>
    类型：<input type="radio" name="type" value="0" th:attr="checked=${emp.type==0}"/>管理员
    <input type="radio" name="type" value="1" th:attr="checked=${emp.type==1}"/>测试
    <br/>
    所属部门:<select name="did" >
    <option th:each="d : ${dList}" th:value="${d.did}" th:text="${d.dname}" th:attr="checked=${emp.did==d.did}"></option>
</select><br>
    <input type="submit" value="确定"/><br/>
</form>
</body>
</html>